home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / lib / partman / active_partition / 45jfs / choices next >
Encoding:
Text File  |  2009-04-19  |  1.3 KB  |  71 lines

  1. #!/bin/sh
  2.  
  3. . /usr/share/debconf/confmodule
  4.  
  5. set -e
  6.  
  7. dev=$1
  8. id=$2
  9. part=$dev/$id
  10.  
  11. cd $dev
  12.  
  13. [ -f $part/method -a -f $part/acting_filesystem ] || exit 0
  14.  
  15. filesystem=$(cat $part/acting_filesystem)
  16.  
  17. case "$filesystem" in
  18.     jfs)
  19.     :
  20.     ;;
  21.     *)
  22.     exit 0
  23.     ;;
  24. esac
  25.  
  26. choice_mountpoint () {
  27.     case "$filesystem" in
  28.         jfs)
  29.         if [ -f $part/mountpoint ]; then
  30.             mp=$(cat $part/mountpoint)
  31.         else
  32.             db_metaget partman-basicfilesystems/text/no_mountpoint description
  33.             mp="$RET"
  34.         fi
  35.         db_metaget partman-jfs/text/specify_mountpoint description
  36.         printf "mountpoint\t%s\${!TAB}%s\n" "$RET" "$mp"
  37.         ;;
  38.     esac
  39. }
  40.  
  41. choice_options () {
  42.     db_metaget partman-basicfilesystems/text/options description
  43.     printf "options\t%s\${!TAB}%.45s\n" "$RET" "$(get_mountoptions $dev $id)"
  44. }
  45.  
  46. choice_label () {
  47.     # allow to set label only if the partition is to be formatted
  48.     [ -f $part/format ] || return 0
  49.     [ ! -f $part/formatted \
  50.       -o $part/formatted -ot $part/method \
  51.       -o $part/formatted -ot $part/filesystem ] || return 0
  52.     case "$filesystem" in
  53.         jfs)
  54.         if [ -f $part/label ]; then
  55.             label=$(cat $part/label)
  56.         else
  57.             db_metaget partman-basicfilesystems/text/none description
  58.             label=$RET
  59.         fi
  60.         db_metaget partman-basicfilesystems/text/specify_label description
  61.         printf "label\t%s\${!TAB}%s\n" "$RET" "$label"
  62.         ;;
  63.     esac
  64. }
  65.  
  66. choice_mountpoint
  67.  
  68. choice_options
  69.  
  70. choice_label
  71.